﻿<%@ Page Language="C#" MasterPageFile="~/Shared/Masters/Form.master" AutoEventWireup="true" CodeFile="FirstAssignAdd.aspx.cs" 
Inherits="Modules_Personal_FirstAssignAdd" Title="分配指标" %>

<asp:Content ID="Content2" ContentPlaceHolderID="idFormMain" Runat="Server">
<link href="../../Scripts/css/checktree2/checktree.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../../Scripts/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../../Scripts/jquery.checktree.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("ul.checktree").checkTree();
});
</script>
    <h2>
       <asp:Label ID="lblTitle" runat="server" Text="分配指标" ></asp:Label>
    </h2>
<div>
    <table cellpadding='2' cellspacing='1' class='ow_fim_mg' width='100%'>
                <tr>
                    <td class='fi_l'>
                        <asp:Label ID="lbCode" runat="server" Text="单位:"></asp:Label><font color='red'>*</font>
                        <input type="hidden" runat="server" ID="hdnOrgID" class="js_unique_for_orgids" value="" />
                    </td>
                    <td class='fi_r' colspan="3">
                        <div class="chkl" style="height:300px">
                            <ul class="checktree" style="margin-left: 15px;" runat="server" id="treeContainer"></ul>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class='fi_l'>
                        <asp:Label ID="lbName" runat="server" Text="岗位:"></asp:Label><font color='red'>*</font>
                    </td>
                    <td class='fi_r'>
                        <asp:DropDownList ID="ddlPost" runat="server" Width="125px"></asp:DropDownList>
                        <asp:RequiredFieldValidator ID="rfvPost" runat="server" ErrorMessage="请选择岗位" ValidationGroup="oss"
                    ControlToValidate="ddlPost">*</asp:RequiredFieldValidator>
                        </td>
                   <td class='fi_l'>
                        <asp:Label ID="lbTarget" runat="server" Text="指标套:"></asp:Label><font color='red'>*</font>
                    </td>
                    <td class='fi_r'>
                        <asp:DropDownList ID="ddlTargetOwner" runat="server" Width="280px">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="rfvTargetOwner" runat="server" ErrorMessage="请选择指标" ValidationGroup="oss"
                    ControlToValidate="ddlTargetOwner">*</asp:RequiredFieldValidator>
                    </td>  
                </tr>   
                      
            </table>
</div>

<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
        ShowSummary="False" ValidationGroup="oss" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="idFormButton" Runat="Server">
  <asp:Button ID="btnSave" runat="server" Text="保存"  ValidationGroup="oss"
        OnClick="btnSave_Click" OnClientClick="doSave();" />
    <asp:Button ID="CloseButton" runat="server" Text="关闭" 
        OnClientClick="return closeForm();" />   
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="idScript" runat="Server">

    <script type="text/javascript">
        function closeForm() {
            window.returnValue="false";
            window.opener=null;
            window.close();
            return false;
        } 
       
        function doSave() {
            var strOrgs = "";
            var chks = $("div.checked");
            
            for(var i = 0; i < chks.length; i++) {
                var chkb = $(chks[i].parentNode).find("input[name='orgid']");
                if(chkb.length > 0) 
                    strOrgs = strOrgs + chkb[0].value + ",";
            }
            
            if(strOrgs != "") {
                strOrgs = strOrgs.substring(0, strOrgs.length - 1);
            }
            
            $("input.js_unique_for_orgids").val(strOrgs);
        }
    </script>

</asp:Content>



